package com.star.common.core.contract.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 常用错误码定义
 *
 * @author zhouhengzhe
 * @公众号 小白的Java进阶之路
 */
@Getter
@AllArgsConstructor
public enum ResultCodeEnum implements IEnum<Integer> {
    OK(200, "请求/操作成功"),
    BAD_REQUEST(400, "请求异常"),
    UNAUTHORIZED(401, "未登录或token已经失效"),
    FORBIDDEN(403, "没有权限"),
    URL_NOT_FOUND(404, "请求地址不存在"),
    REQUEST_METHOD_NOT_SUPPORTED(405, "不支持当前请求方法"),
    REQUEST_MEDIA_TYPE_NOT_SUPPORTED(415, "不支持当前媒体类型"),
    SERVER_ERROR(500, "服务器异常"),
    FAIL(501, "请求成功但是服务异常"),
    LOG_OUT(530, "当前用户被挤下线!"),
    VALID_ENUM(531, "登录方式有误!"),
    USER_NOT_LOGIN_OR_EXPIRE(532, "【用户未登录】 或 【登录过期】!"),
    ILLEGAL_ARGUMENT_EX(1001, "非法状态/参数异常"),
    MISSING_SERVLET_REQUEST_PARAMETER(1002, "遗失request请求参数"),
    NULL_POINT(1003, "空指针异常，请查看是否没判空"),
    MEDIA_TYPE_EX(1004, "请求类型异常"),
    PARAMETER_VALIDATION_FAILED(1005, "参数校验失败"),
    REQUIRED_FILE_PARAM_EX(1006, "请求中必须至少包含一个有效文件"),
    BASE_VALID_PARAM(1007, "统一验证参数异常"),
    SQL_EX(1008, "运行SQL出现异常"),
    METHOD_NOT_ALLOWED(1009, "不支持当前请求类型"),
    UPLOAD_FILE_ERROR(1010, "上传文件异常"),
    NO_ACCESS_TOKEN(1011, "没有权限，缺少AccessToken"),
    TIMEOUT(1012, "登录超时，请重新登录"),
    NO_SESSION(1013, "session不能为空"),
    LOGIN_FIRST(1014, "请先登录"),
    NOT_FUND_APP_KEY(1015, "路由key不正确"),
    ARGUMENT_NULL(1016, "参数不能为空"),
    REQUEST_REPEAT(1017, "请求频繁,请求稍后再试"),
    URL_IS_NULL(1018, "url为空"),
    EMAIL_TEMPLATE_RESOURCE_ID_NOT_MATCH(1019, "邮件模板资源id和资源路径不匹配"),
    EMAIL_TEMPLATE_NOT_CONFIGURED(1020, "邮件模板未配置，如需不要多语言请配置默认的EN(英文)模版"),
    SMS_TEMPLATE_NOT_CONFIGURED(1021, "短信模板未配置，如需不要多语言请配置默认的EN(英文)模版"),
    EXPORT_EXCEL_FILL_WITHOUT_TEMPLATE(1022, "@ExportExcel fill 必须配合 template 使用"),
    EXPORT_EXCEL_RETURN_TYPE_ERROR(1023, "@ExportExcel 返回值必须为List类型"),
    ACCESS_TOKEN_NULL(1024, "access token is null or secret is null"),
    AUTHORIZATION_ERROR(1025, "授权信息异常"),
    REQUEST_INVALID(1026, "请求失效"),
    VERSION_FORMAT_ERROR(1027, "版本号格式不正确"),
    SIGN_IS_NULL(1028, "签名为空"),
    TIMESTAMP_IS_NULL(1029, "时间戳为空"),
    REQUEST_IS_NULL(1030, "请求ID为空"),
    NONCE_IS_NULL(1031, "随机数为空"),
    VERSION_IS_INVALID(1032, "版本号不正确"),
    ALIYUN_OSS_STS_ERROR(1033, "获取临时访问凭证失败"),
    ALIYUN_OSS_ACS_RESPONSE_NULL(1034, "the acs response is null"),
    OSS_UPLOAD_FILE_NULL(1035, "上传文件返回值为空"),
    PARAM_NULL(1036,"参数为空"),
    FUTURE_DEVELOPMENT(1037, "功能开发中"),
    ;
    private final Integer code;
    private final String desc;
}